package cbbx_sm.livecamera;

import java.net.Authenticator;
import java.net.PasswordAuthentication;


public class MyAuthenticator extends Authenticator implements java.io.Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = -9175197798889119797L;
	private String user = null;
	private String password = null;

	private final static String CAMAS_CAMERA_USER = "rescue";
	private final static String CAMAS_CAMERA_PASSWORD = "rescue";
/**
 * this constructor creates an authenticator with default rescue user and password
 *
 */
	public MyAuthenticator()
	{
		constructor(CAMAS_CAMERA_USER, CAMAS_CAMERA_PASSWORD);
	}
	
	public MyAuthenticator(String user, String password)
	{
		constructor(user, password);
	}
	
	private void constructor(String user, String password)
	{
		this.user=user;
		this.password=password;
	}
	protected PasswordAuthentication getPasswordAuthentication()
	{
    	return new PasswordAuthentication(user, password.toCharArray());
  	}
}